Ext.ns('App.Store');

App.Store.Counter = new Ext.data.Store({
	storeId  : 'counterStore',

	model    : 'modelCounter',
	belongsTo: {
		model         : 'modelPreset',
		associationKey: 'presetName'
	},

/**** Fake Data need to find solution ****/	
	autoLoad : true,
	proxy: {
		type: 'ajax',
		url : 'res/data/dummyData2.json',
		reader: {
			type: 'json',
			root: 'dataRoot'
		}
	},
/**** Fake Data need to find solution ****/	
	
	sorters  : [{
		property : 'id',
		direction: 'ASC'
	}],
	getGroupString : function(record) {
	    return record.get('counterGroup');
	}
});

/**
 * What data do we got here?
 **
}).load({
	callback: function() {
        //the preset that was loaded
        var presets = this.first();
        		console.log("------------------------------");
		   	    console.log("Counter of " + presets.get('presetName') + ":");
		   	    console.log(presets.data);
	        presets.data.counterSet().each(function(counter){
	            console.log("id: "       + counter.get('id'));
	            console.log("counterGroup: "    + counter.get('counterGroup'));
	            console.log("counterGfx: "      + counter.get('counterGfx'));
	            console.log("counterDown: "     + counter.get('counterDown'));
	            console.log("counterDuration: " + counter.get('counterDuration'));
	        });
    }
});
*/